import { createRouter, createWebHistory } from 'vue-router'
import Home from '@/views/Home.vue'
import Login from '@/views/loge/Login.vue'
import Phone from '@/views/loge/Phone.vue'
import Search from '@/views/Search.vue'
import Cart from '@/views/Cart.vue'
import Confirm from '@/views/Confirm.vue'
import Navigation from '@/views/Navigation.vue'
import My from '@/views/My/My.vue'
import Classify from '@/views/Classify.vue'
import Register from '@/views/loge/Register.vue'
import Detail from '@/views/Detail.vue'
import Address from '@/views/Address.vue'
import Checkaddress from '@/views/Checkaddress.vue'
import MessageDeatil from '@/components/MessageDeatil.vue'


// import Register from '@/views/Register.vue'
// 
// import All from '@/views/My/All.vue'
// import Oders from '@/views/My/Oders.vue'
// import Unpaid from '@/views/My/Unpaid.vue'
// import Paid from '@/views/My/Paid.vue'
// import Pickedup from '@/views/My/Pickedup.vue'



// 我的页面跳转
import All from '@/views/My/All.vue'
import Oders from '@/views/My/Oders.vue'
import Unpaid from '@/views/My/Unpaid.vue'
import Paid from '@/views/My/Paid.vue'
import Pickedup from '@/views/My/Pickedup.vue'
import Comment from '@/views/My/Comment.vue'
//地图
import Map from '@/views/My/Map.vue'





import Checkpay from '@/views/Checkpay.vue'
import LiveStream from '@/views/LiveStream.vue'




const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    // 导航栏路由
    {
      path:'/',
      component:Navigation,
      redirect:'/home',
      children:[
        {
          path: '/home',
          name: 'home',
          component: Home,
      },
      {
       path:'/classify',
      name:'classify',
      component:Classify,
      },
      {
        path:'/cart',
       name:'cart',
       component:Cart,
       },
       {
        path:'/my',
       name:'my',
       component:My,

       },
      ]
    },

// 我的页面订单跳转
    {
      path:'/all',
      component:All,
      children:[
        {
      path:'/oders',
      name:'alloders',
      component:Oders,
    },
    {
      path:'/unpaid',
      name:'unpaid',
      component:Unpaid,
    },
    {
      path:'/paid',
      name:'paid',
      component:Paid,
    },
    {
      path:'/pickedup',
      name:'pickedup',
      component:Pickedup,
    },
      ]
    },
    // 地图路由
    {
      path:'/map',
      name:'map',
      component:Map,
    },

  //  登录页面
   {
     path:'/login',
     name:'login',
     component:Login,
   },
   //用户注册
   {
    path:'/register',
    name:'register',
    component:Register,
  },
  {
    path:'/detail',
    name:'detail',
    component:Detail,
  },
  
   {
    path:'/phone',
   name:'phone',
   component:Phone,
   },
   {
    path:'/search',
   name:'search',
   component:Search,
   },

   {
    path:'/confirm',
   name:'confirm',
   component:Confirm,
   },
   {
    path:'/navigation',
   name:'navigation',
   component:Navigation,
   },
   {
    path:'/checkpay',
   name:'checkpay',
   component:Checkpay,
   },
   {
    path:'/livestream',
   name:'livestream',
   component:LiveStream,
   },
   {
    path:'/address',
   name:'address',
   component:Address,
   },
   {
    path:'/checkaddress',
   name:'checkaddress',
   component:Checkaddress,
   },

   {
    path: '/messageDetail',
    component: MessageDeatil,
    meta:{title:'消息详情'}
  },
   {
    path: '/comment',
    component: Comment,
    meta:{title:'订单详情'}
  },
   
  ]
})
export default router
